package com.tjh.springbootapi.controller;

import com.koala.apiprototype.annotations.IgnoreValidate;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestPart;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

@RestController
@RequestMapping("/upload")
public class UploadController {

    /**
     * 上传图片
     *
     * @param name  额外的参数
     * @param files 图片文件
     */
    @IgnoreValidate
    @PostMapping("/uploadImg")
    public void uploadImg(String name, @RequestPart(value = "files", required = false) MultipartFile[] files) {
        System.out.println(files);
    }

}
